package com.naiterui.ehp.bs.ds.modules.order.feign;

import java.util.Set;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.naiterui.ehp.bp.bo.b2c.OrderDeliveryBO;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;

/**
 * 订单远程接口
 *
 * @author wangzehao
 * @date 2019-01-28 11:42
 * @since 1.0.0
 */
@RequestMapping("/inner/cms/orders")
@FeignClient(name = "order", url = "${ehp.domain.b2c}", configuration = FeignConfiguration.class)
public interface IOrderFeignClient {

    /**
     * 批量确认/批量拒绝
     */
    @PostMapping("/warehouse/{warehouseId}/{status}")
    void warehouseConfirmOrder(@PathVariable Long warehouseId, @RequestBody Set<Long> orderIds,
                               @PathVariable Integer status) throws BusinessException;

    /**
     * 发货
     */
    @PostMapping("/{warehouseId}/delivery")
    void delivery(@PathVariable Long warehouseId, @RequestBody Set<OrderDeliveryBO> deliveryInfo) throws BusinessException;
}
